/**
This file is part of Gel2DE.

    Gel2DE is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Gel2DE is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with Gel2DE.  If not, see <http://www.gnu.org/licenses/>.

	Copyright (C) 2012, University of Bergen
*/

#include "SpearmanRankElement.h"

SpearmanRankElement::SpearmanRankElement(double ax, double ay)
{
	m_x = ax;
	m_y = ay;
}

SpearmanRankElement::~SpearmanRankElement(void)
{
}

void SpearmanRankElement::SetRankX(float aRank)
{
	m_R = aRank;
}

void SpearmanRankElement::SetRankY(float aRank)
{
	m_S = aRank;
}

void SpearmanRankElement::SetRank(int aRef, float aRank)
{
	if(aRef == X)
	{
		SetRankX(aRank);
	}
	else
	{
		SetRankY(aRank);
	}
}

const float SpearmanRankElement::GetRankX() const
{
	return m_R;
}

const float SpearmanRankElement::GetRankY() const
{
	return m_S;
}

const float SpearmanRankElement::GetRank(const int aRef) const
{
	if(aRef == X)
	{
		return GetRankX();
	}
	else
	{
		return GetRankY();
	}
}

const double SpearmanRankElement::GetValueX() const
{
	return m_x;
}

const double SpearmanRankElement::GetValueY() const
{
	return m_y;
}

const double SpearmanRankElement::GetValue(const int aRef) const
{
	if(aRef == X)
	{
		return GetValueX();
	}
	else
	{
		return GetValueY();
	}

}